package com.ruoyi.tj.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ruoyi.tj.entity.Photograph;
import com.ruoyi.tj.mapper.PhotographMapper;
import com.ruoyi.tj.service.PhotographService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 体检照片 服务实现类
 * </p>
 *
 * @author aoliao
 * @since 2024-03-16
 */
@Service
public class PhotographServiceImpl extends BaseBizServiceImpl<PhotographMapper, Photograph> implements PhotographService {

    @Override
    public void deleteByInfoId(String infoId) {
        LambdaQueryWrapper<Photograph> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(Photograph::getInfoId, infoId);
        this.getBaseMapper().delete(queryWrapper);
    }

    @Override
    public List<Photograph> selectByInfoId(String infoId) {
        LambdaQueryWrapper<Photograph> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(Photograph::getInfoId, infoId);

        return this.getBaseMapper().selectList(queryWrapper);
    }

    @Override
    public List<Photograph> selectByInfoIds(List<String> infoIds) {

        LambdaQueryWrapper<Photograph> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.in(Photograph::getInfoId, infoIds);

        return this.getBaseMapper().selectList(queryWrapper);
    }
}
